#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
bool repeatedSubstringPattern(char* s)
{
    int i, j;
    int len = (int)strlen(s);
    if (len < 2)
        return false;
    for (int i = 1; i <= len / 2; i++)
    {
        int tmp = i;
        for (int j = 0; s[tmp] == s[j]; j++, tmp++)
        {
            if (tmp == len - 1 && len % i == 0)
            {
                return true;
            }
        }
    }
    return false;
}
int main()
{
    char s[] = "babbabbab";
    printf("%d\n", repeatedSubstringPattern(s));
    return 0;
}